package com.dlc.shop.systemtest.api.amount;

import com.dlc.shop.common.util.PageParam;
import com.dlc.shop.distribution.api.param.DistributionWithdrawCashSaceParam;
import com.dlc.shop.distribution.common.dto.DistributionWithdrawCashDto;
import com.dlc.shop.systemtest.constants.Constant;
import com.dlc.shop.systemtest.util.HttpUtil;

/**
 * 分销员提现接口
 * @author: zsm
 * @date: 2023/2/28 9:28
 */
public class DistributionWithdrawCashApi {

    /**
     * 用户发起提现申请
     * @param distributionWithdrawCashSaceParam 填入提现参数
     */
    public static void apply(DistributionWithdrawCashSaceParam distributionWithdrawCashSaceParam){
        String url = Constant.API_URL + "/p/distribution/withdrawCash/apply";
        HttpUtil.post(url,distributionWithdrawCashSaceParam);
    }

    /**
     * 查看用户总提现金额
     * @return
     */
    public static Double getUserTotalWithdrawCash(){
        String url = Constant.API_URL + "/p/distribution/withdrawCash/totalWithdrawCash";
        return HttpUtil.get(url,Double.class);
    }

    /**
     * 分页查看提现记录
     * @param page
     * @return
     */
    public static void page(PageParam<DistributionWithdrawCashDto> page) {
        String url = Constant.API_URL + "/p/distribution/withdrawCash/page";
        HttpUtil.get(url);
    }
}
